/* 
 * BAT_Factory.h
 *
 * Factory for all plugin classes in BAT.
 *
 * $Id: BAT_Factory.h 923 2006-09-01 23:01:24Z rpz $
 *
 * Bob Zimmermann <rpz@cse.wustl.edu>
 * Totally free.
 *
 */

#include "keyed_set.h"
#include "BAT_Parser.h"
#include "BAT_Validator.h"
#include "BAT_Writer.h"

#ifndef BAT_FACTORY_H
#  define BAT_FACTORY_H

typedef struct _BAT_Factory BAT_Factory;

struct _BAT_Factory
{
  int refcount;
  keyed_set_t *parsers;
  keyed_set_t *validators;
  keyed_set_t *writers;
};

BAT_Factory *BAT_Factory_new ();
void BAT_Factory_delete (BAT_Factory * f, int);

BAT_Parse_Plugin *BAT_Factory_get_parse_plugin (BAT_Factory * f,
						BAT_Parser_Type t);
BAT_Validate_Plugin *BAT_Factory_get_validate_plugin (BAT_Factory * f,
						      BAT_Validator_Type t);
BAT_Write_Plugin *BAT_Factory_get_write_plugin (BAT_Factory * f,
						BAT_Writer_Type t);

darray_t *BAT_Factory_get_parse_plugins (BAT_Factory * f);
darray_t *BAT_Factory_get_validate_plugins (BAT_Factory * f);
darray_t *BAT_Factory_get_write_plugins (BAT_Factory * f);

#endif
